import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { StudentTakeVO, StudentTakeForm, StudentTakeQuery } from '@/api/school/studentTake/types';

/**
 * 查询通知学生拿东西列表
 * @param query
 * @returns {*}
 */

export const listStudentTake = (query?: StudentTakeQuery): AxiosPromise<StudentTakeVO[]> => {
  return request({
    url: '/school/studentTake/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询通知学生拿东西详细
 * @param id
 */
export const getStudentTake = (id: string | number): AxiosPromise<StudentTakeVO> => {
  return request({
    url: '/school/studentTake/' + id,
    method: 'get'
  });
};

/**
 * 新增通知学生拿东西
 * @param data
 */
export const addStudentTake = (data: StudentTakeForm) => {
  return request({
    url: '/school/studentTake',
    method: 'post',
    data: data
  });
};

/**
 * 修改通知学生拿东西
 * @param data
 */
export const updateStudentTake = (data: StudentTakeForm) => {
  return request({
    url: '/school/studentTake',
    method: 'put',
    data: data
  });
};

/**
 * 删除通知学生拿东西
 * @param id
 */
export const delStudentTake = (id: string | number | Array<string | number>) => {
  return request({
    url: '/school/studentTake/' + id,
    method: 'delete'
  });
};
